home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1306 / ptw32.zip / DDE.PSL < prev    next >
Text File  |  1994-09-11  |  646b  |  25 lines

  1. #
  2. # a DDE client example.
  3. #
  4.  
  5. # Assigns three numbers on the emulation screen to array "cel"
  6. for {i = 1} {$i < 4} {incr i} {
  7.  row = [expr $i + 3]
  8.  cel($i) = [screen-rect $row 10 $row 15]
  9. }
  10.  
  11. # Initiates a DDE conversation with MicroSoft Excel file TEST.XLS.
  12. conv = [dde initiate EXCEL TEST.XLS]
  13.  
  14. # Pokes the three numbers to three cels in TEST.XLS.
  15. for {i = 1} {$i < 4} {incr i} {dde poke $conv R1C$i $cel($i)}
  16.  
  17. # Requests the sum of those numbers from a result cel in TEST.XLS.
  18. sum = [dde request $conv "R2C1"]
  19.  
  20. # Terminates the DDE conversation.
  21. dde terminate $conv
  22.  
  23. # Sends the result to the host application.
  24. send $sum
  25.